package com.cosc.apgs.param.service.impl;

import com.cosc.apgs.param.data.UserInfoDO;
import com.cosc.apgs.param.entity.User;
import com.cosc.apgs.param.mapper.UserMapper;
import com.cosc.apgs.param.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Howl-Xu
 * @version 1.0.0
 * @Description: UserService实现类
 * @createTime 2020年11月09日 13:33:00
 */

@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private UserMapper userMapper;

    //获取用户信息
    @Override
    public UserInfoDO getUserInfo(String account, String password) {
        User user = userMapper.getUser(account, password);
        UserInfoDO userInfoDO = new UserInfoDO();
        userInfoDO.setAccount(user.getAccount());
        userInfoDO.setUuid(user.getUuid());
        userInfoDO.setUserName(user.getUserName());
        return userInfoDO;
    }
}
